package com.zjitc.chapter10.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Spring MVC URLs typically consist of the following components:
 *
 * 1. Protocol: This is usually http or https, indicating the protocol used for the request.
 *
 * 2. Domain: This is the domain name or IP address of the server where the application is hosted.
 *
 * 3. Port: This is the port number on which the server is listening for requests. The default port for HTTP is 80, and for HTTPS is 443.
 *
 * 4. Context Path: This is the root path of the web application on the server. In your case, it seems to be /chapter10.
 *
 * 5. Servlet Mapping: This is the mapping of the servlet within the application. In Spring MVC, this is often defined using @RequestMapping annotations on controller methods.
 *
 * 6. Request Mapping: This is the additional path specified in the request URL that maps to a specific controller and method in the Spring MVC application.
 *
 * For example, a complete URL for a Spring MVC application might look like this:
 *
 * This URL includes the protocol, domain, port, context path, servlet mapping, and request mapping.
 */
@Controller
public class GreetingController {
    @RequestMapping("/hello")
    public String hello() {
        System.out.println("HelloController.hello");
        return "hello";
    }
}
